package 代码记录.指定公司代码练习记录.华为_2024.分值100.第36start;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

/**
 * @author zx
 * @create 2024-02-16 13:14
 * 人家的思路把这道题做的很简单，自己可能会想复杂
 */
public class API集群负载统计_54 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.nextLine());
        List<String[]> list = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            String[] words = sc.nextLine().split("/");
            list.add(words);
        }
        String[] temp = sc.nextLine().split(" ");
        int L = Integer.parseInt(temp[0]);
        String word = temp[1];
        int res = 0;
        for (String[] words : list) {
            if (words.length <= L) {
                continue;
            }
            if (words[L].equals(word)) {
                res++;
            }
        }
        System.out.println(res);
    }
}















